<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="./common/header.jsp" %>
<body>
<%@ include file="./common/top.jsp"%>

<div class="container">
	<form class="form-inline" id="search_form" role="form" style="margin-bottom:20px;">
	  <div class="form-group">
	    <label class="sr-only" for=""></label>
	    <input type="text" class="form-control" name="mobile" id="title_search_id" placeholder="手机号码"/>
	  </div>
	  
	  <button type="button"  id="search_id" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span>搜索</button>
	</form>		
			
	
	<div style="margin-top:20px;">
		<table id="customer_table">
	
		</table>
	
	</div>
	</div>
	
		
	
	<script>
		$(function() {
			var grid = new jWei.Datagrid({
				renderTo : $("#customer_table"),
				tabWidth:"",
				fieldset:false,
				legendTitle:"积分日志列表",
				url : "../admin/integrallog/pageList.do",
				colModels : [ 
				
				{
					name : "createTime",
					displayName : "创建时间",
				},
				{
					name : "integrallog_customerId",
					displayName : "用户ID",
				},
				{
					name : "integrallog_goodsId",
					displayName : "商品ID",
				},
				
				{
					name : "integrallog_integral",
					displayName : "积分变更明细",
                    handler:function(v,data,td,tr){
                        if(data.integrallog.type == 1) {
                            td.html('+'+v);
                        } else if(data.integrallog.type == 2){
                            td.html('-'+v);
                        } else if(data.integrallog.type == 3) {
                            td.html('-'+v);
                        }
                    }
				},
				{
					name : "integrallog_type",
					displayName : "变更类型",
                    handler:function(v,data,td,tr){
					    if(v == 1) {
					        td.html('游戏失败赠送');
						} else if(v == 2){
					        td.html('游戏闯关成功清空');
						} else if(v == 3) {
                            td.html('积分购买商品');
						}
					}
				}

				]
			});
			
			$("#search_id").click(function(){
				grid.search("search_form");
				return false;
			});
		 
			$('#title_search_id').bind('keypress',function(event){
	            if(event.keyCode == "13")    
	            {
	            	$("#search_id").trigger("click");
	            	return false;
	            }
	        });
		
		

	});

	</script>
</body>
</html>